# Python 获取字符串长度或字节数
a = "http://c.biancheng.net"
print("len(a) =", len(a))
print()

str1 = "人生苦短，我用Python"
print("len(str1.encode()) =", len(str1.encode()))
print()

str1 = "人生苦短，我用Python"
print("len(str1.encode('gbk')) =", len(str1.encode("gbk")))
print()
